package cn.zjyj.module.zjyj.dal.mysql.risklist;

import cn.zjyj.framework.common.common.pojo.PageResult;
import cn.zjyj.framework.datasource.mybatis.core.query.LambdaQueryWrapperX;
import cn.zjyj.framework.datasource.mybatis.core.mapper.BaseMapperX;
import cn.zjyj.module.zjyj.dal.dataobject.risklist.RiskListDO;
import org.apache.ibatis.annotations.Mapper;
import cn.zjyj.module.zjyj.controller.admin.risklist.vo.*;

/**
 * 风险清单 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface RiskListMapper extends BaseMapperX<RiskListDO> {

    default PageResult<RiskListDO> selectPage(RiskListPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RiskListDO>()
                .betweenIfPresent(RiskListDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(RiskListDO::getType, reqVO.getType())
                .likeIfPresent(RiskListDO::getName, reqVO.getName())
                .eqIfPresent(RiskListDO::getDescription, reqVO.getDescription())
                .eqIfPresent(RiskListDO::getStatus, reqVO.getStatus())
                .orderByDesc(RiskListDO::getId));
    }

}